import { OrderStatusApi } from '@/api/payment';

export function getOrderStatus(status) {
  const statusText = [
    '核查中',
    '核查超时',
    '异常订单',
    '异常锁单',
    '异常锁单',
    '手动取消',
    '已完成',
    '已结束',
    '系统强补',
    '超时处罚',
    '系统取消',
    '已完成',
  ];
  return statusText[status];
}

export async function getPaymentOrderStatus(status: number) {
  const { data } = await OrderStatusApi();
  return data[status];
}

export function getOrderColor(status) {
  let color = {
    color: '',
    backgroundColor: '',
  };
  switch (status) {
    case 9:
      color = {
        color: 'orange',
        backgroundColor: '#B4140B',
      };
      break;
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 8:
    case 10:
      color = {
        color: '#ffffff',
        backgroundColor: '#B4140B',
      };
      break;
    case 6:
      color = {
        color: '#0576b2',
        backgroundColor: '#dbf0fb',
      };
      break;
    default:
      color = {
        color: '#0576b2',
        backgroundColor: '#dbf0fb',
      };
  }
  return color;
}

export function getPaymentOrderColor(status) {
  let color = {
    color: '',
    backgroundColor: '',
    border: '1px solid #C5DBDB',
  };
  switch (status) {
    case 9:
      color = {
        color: 'orange',
        backgroundColor: '#B4140B',
      };
      break;
    case 1:
    case 2:
    case 3:
    case 4:
    case 7:
      color = {
        color: '#234C4C',
        backgroundColor: '#CFCFCF',
        border: '1px solid #C5DBDB',
      };
      break;
    case 5:
      color = {
        color: '#32559E',
        backgroundColor: '#1D4195',
        border: '1px solid #C5DBDB',
      };
      break;
    case 8:
    case 10:
      color = {
        color: '#ffffff',
        backgroundColor: '#B4140B',
      };
      break;
    case 6:
      color = {
        color: '#33B90A',
        backgroundColor: '#E8FDE2',
      };
      break;
    default:
      color = {
        color: '#0576b2',
        backgroundColor: '#dbf0fb',
      };
  }
  return color;
}
